#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

void fatherfunc()
{
	printf("I am father.\n");
}

void childfunc()
{
	printf("I am child.\n");
}

int main()
{
	if(fork()>0)
	{
		printf("This is father process, fatherfunc() will be called.\n");
		fatherfunc();
	}
	else
	{
		sleep(5);
		printf("This is child process, childfunc() will be called.\n");
		childfunc();
	}
	sleep(1);
	printf("All process will come to here after calling xxxfunc().\n");
	sleep(1);
	return 0;
}
